package com.ljkj.cordial.chat.activity;

import android.app.Activity;
import android.content.Intent;
import android.widget.TextView;

import com.ljkj.cordial.chat.R;
import com.ljkj.cordial.chat.base.BaseActivity;
import com.ljkj.cordial.chat.base.ChatApp;
import com.ljkj.cordial.chat.bean.Canstants;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 注册成功
 */
public class RegisterSuccessActivity extends BaseActivity {


    @BindView(R.id.tv_desc)
    TextView tvDesc;
    @BindView(R.id.tv_register)
    TextView tvRegister;

    @Override
    public int getContentLayoutId() {
        return R.layout.activity_register_success;
    }

    @Override
    public void initView() {
        ButterKnife.bind(this);
        tvDesc.setText(String.format("您申请的注册账号ID为%s", ChatApp.getInstance().getUserId()));
        getToolbar().setNavigationIcon(null);
    }

    @OnClick(R.id.tv_register)
    public void onViewClicked() {
        ChatMainActivity.jumpTo(this, false);
        setResult(Canstants.REQUEST_CODE_BACK);
        finish();
    }

    public static void jumpTo(Activity activity) {
        Intent intent = new Intent(activity, RegisterSuccessActivity.class);
        activity.startActivityForResult(intent, Canstants.REQUEST_CODE_BACK);
    }
}
